Tom,
My ATC "driver" is working perfectly running a stand-alone test, so I set it up as an M6 handler, using the "Program and Wait" action. But, I've run into a problem. When I run G-code, and it encounters an M6, it loads and runs my driver, but the driver hangs
part-way through. The relevent section of code is below. The first printf ("In Grab...") comes out, and shows CheckDone returns 1. The second printf ("Doing Move...") does not come out. It is NOT executing the if and returning. If I hit Stop, to stop the interpreter,
then this code picks up and starts running again, like nothing ever happened. So, it appears to be hanging in the if statement, until the interpreter is stopped, which makes no sense to me. Must be something to do with the ReadBits?
void PDBGrab(float turns)
{
printf("In Grab(%d)\n", CheckDoneXYZABC());
if (!CheckDoneXYZABC() ||
ReadBit(DRAWBAR_ACTIVATE) ||
ReadBit(SPINDLE_CW) ||
ReadBit(SPINDLE_CCW) ||
ReadBit(COOLANT_MIST) ||
ReadBit(COOLANT_FLOOD))
return;
printf("@Doing Move\n");
Move(AXIS_Z, -0.025 * B_STEPS_PER_INCH);
printf("@Done\n");
while (!CheckDoneXYZABC())
;
...
Any ideas? This does not happen if the action type is Program, rather than ProgramWait. But, of course, then the interpreter does not wait for the toolchange to complete before moving on.
Regards,
Ray L.